{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=158
  Verdict: Accepted
}
uses 
	SysUtils, Math;
 
var
	n,i:longint;
	r:array[0..10] of longint;
	c:array[0..1270] of int64;
 
function root3(i:longint):longint;
begin
result:=trunc(exp(ln(i)/3));
end;
 
procedure go(s,k:longint);
 
var
	kk,i,rr:longint;
 
begin
if s>8 then exit;
kk:=root3(k);
if c[kk]=k then rr:=kk else rr:=-1;
if rr>0 then begin  	
	r[s]:=kk;
	for i:=1 to s do
		write(r[i],' ');
	halt(0);
end;
rr:=min(kk,r[s-1]);
for i:=rr downto 1 do begin
	r[s]:=i;
	go(s+1,k-c[i]);
end;
end;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n);
for i:=1 to 1260 do
	c[i]:=int64(i)*int64(i)*int64(i);
r[0]:=1010;
go(1,n);
write('IMPOSSIBLE');
end.